package com.sugon.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.sugon.dao.ModuleSeriesTypeDao;
import com.sugon.entity.ModuleSeriesTypeEntity;
import com.sugon.service.ModuleSeriesTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 模具系列类型Service实现类
 *
 * @author sugon
 * @date 2019-08-19 10:42:29
 */
@Service("moduleSeriesTypeService")
public class ModuleSeriesTypeServiceImpl implements ModuleSeriesTypeService {
    @Autowired
    private ModuleSeriesTypeDao moduleSeriesTypeDao;

    @Override
    public ModuleSeriesTypeEntity queryObject(String id) {
        return moduleSeriesTypeDao.queryObject(id);
    }

    @Override
    public List<ModuleSeriesTypeEntity> queryList(Map<String, Object> map) {
        return moduleSeriesTypeDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return moduleSeriesTypeDao.queryTotal(map);
    }

    @Override
    public int save(ModuleSeriesTypeEntity moduleSeriesType) {
        moduleSeriesType.setId(RandomUtil.randomString(32));
        moduleSeriesType.setDelFlag(1);
        return moduleSeriesTypeDao.save(moduleSeriesType);
    }

    @Override
    public int update(ModuleSeriesTypeEntity moduleSeriesType) {
        return moduleSeriesTypeDao.update(moduleSeriesType);
    }

    @Override
    public int delete(String id) {
        return moduleSeriesTypeDao.delete(id);
    }

    @Override
    public int deleteBatch(String[] ids) {
        return moduleSeriesTypeDao.deleteBatch(ids);
    }
}
